/**
 * 订单相关API
 */

import request from './index.js'

// 订单相关API
export const orderApi = {
  // 获取订单列表
  getOrderList(params) {
    return request.get('/order/list', params)
  },
  
  // 创建订单
  createOrder(data) {
    return request.post('/order/submit', data, {
      header: {
        'Content-Type': 'application/json;charset=UTF-8'
      }
    })
  },
  
  // 支付订单
  payOrder(data) {
    return request.post('/order/pay', data)
  },

  // 确认收货
  confirmReceipt(data) {
    return request.post('/order/sure', data)
  },

  // 获取订单详情
  getOrderDetail(params) {
    return request.get('/order/detail', params)
  },

  // 获取物流信息
  getLogisticsInfo(params) {
    return request.get('/logistics/info', params)
  }
}

export default orderApi 